const path = require('path');
const abs = require('html-webpack-plugin'); //引入
module.exports = {
    mode: "development",//开发者模式
    entry: './src/index.js',//入口
    //出口
    output: {
        filename: "a.js",
        path: path.resolve(__dirname, 'dist')
    },
    //plugins里面不只有一个插件，所以用数组格式
    plugins: [
        new abs({
            template: "./index.html",
        })
    ],
    module: {
        rules: [
            {
                //$ 以.css为结尾
                test: /\.css$/,
                //顺序是从右往左加载
                use: ['style-loader','css-loader']
            }
        ]
    }
}